package com.cote.douhahou.pretloan.beans;

import android.text.TextUtils;

import com.google.gson.Gson;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.LinkedHashMap;


public class LnLiAkomapalendmitInfo {

    private static class Inner_akomapalend {
        private static LnLiAkomapalendmitInfo instance_akomapalend = new LnLiAkomapalendmitInfo();
    }

    private LnLiAkomapalendmitInfo(){}

    public static LnLiAkomapalendmitInfo instance(){
        return Inner_akomapalend.instance_akomapalend;
    }

    private String newUserFlag;
    private ArrayList<LinkedHashMap<String,String>> limit;

    public static void parse_akomapalend(JSONObject objJson){
        Inner_akomapalend.instance_akomapalend = new Gson().fromJson(objJson.toString(), LnLiAkomapalendmitInfo.class);
    }

    public boolean isNewUSer_akomapalend() {
        if (TextUtils.isEmpty(newUserFlag)) return true;
        return !newUserFlag.equalsIgnoreCase("NO");
    }

    public String getLimitAmount_akomapalend(){
        if (limit == null||limit.size()==0) return "";
        String result = limit.get(0).get("amount");
        if (TextUtils.isEmpty(result)) return "";
        return result;
    }

    public String getCurrency_akomapalend() {
        if (limit == null||limit.size()==0) return "";
        String result = limit.get(0).get("currency");
        if (TextUtils.isEmpty(result)) return "";
        return result;
    }

}
